home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-21 | 1.2 KB | 48 lines | [TEXT/edF6] |
- *******************************
- **Fantasm V4 PowerPC demo #1
- **Opens two windows and runs various graphical tests
- **
- **File:graph_demo_init.s
- **Date: 3rd Dec.95
- **©Lightsoft 1995.
- param1: reg r3 *Set up the names of the regs used for parameter passing
- param2: reg r4
- param3: reg r5
- param4: reg r6
- bss: reg r30 *The register we use for global data
-
- graph_demo_init:
- mflr r29 *save return address
- bl open_window
- mtlr r29
- blr
-
- open_window:
- mflr r28
- li `param1,128 *windows id is 128
- li `param2,0 *clear param2 - storage
- li `param3,-1 *behind
- Xcall GetNewCWindow *Note NewCWindow, else we'd have problems with the colors.
- stw `param1,window_1_ptr(`bss)
- **get the viewable rectangle (top,left,bottom,right)
- la r3,16(r3) *windoptr+16=viewrect
- la r4,viewrect_1(`bss)
- **Copy 2 words using fpu 64 bit regs (note that this will cause a stall and the lfd should
- **be moved up a bit.)
- lfd f0,(r3) *64 bit move into f0
- stfd f0,(r4) *64 bit store into viewrect_1 (cool or what!)
- **And copy to our second rectangle as well
- la r4,viewrect_2(`bss)
- stfd f0,(r4) *into viewrect_2
-
- **set the port to our window
- lwz `param1,window_1_ptr(`bss)
- Xcall SetPort
- lwz r10,white(rtoc)
- mtlr r28
- blr
-
- ****
- global graph_demo_init
- extern_data white
-